<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableItem class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableItem object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableItemMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableItem $TableItem the actual TableItem data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QTextBox $ItemnameControl
	 * property-read QLabel $ItemnameLabel
	 * property QTextBox $ItemnamejpControl
	 * property-read QLabel $ItemnamejpLabel
	 * property QTextBox $Description1Control
	 * property-read QLabel $Description1Label
	 * property QTextBox $Description2Control
	 * property-read QLabel $Description2Label
	 * property QIntegerTextBox $PriceControl
	 * property-read QLabel $PriceLabel
	 * property QIntegerTextBox $TaxWithinControl
	 * property-read QLabel $TaxWithinLabel
	 * property QIntegerTextBox $LicenseDayControl
	 * property-read QLabel $LicenseDayLabel
	 * property QTextBox $SubscriptionControl
	 * property-read QLabel $SubscriptionLabel
	 * property QTextBox $ImageControl
	 * property-read QLabel $ImageLabel
	 * property QTextBox $SimageControl
	 * property-read QLabel $SimageLabel
	 * property QDateTimePicker $SuspendDateControl
	 * property-read QLabel $SuspendDateLabel
	 * property QTextBox $SuspendedControl
	 * property-read QLabel $SuspendedLabel
	 * property QTextBox $ActiveControl
	 * property-read QLabel $ActiveLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableItemMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableItem;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableItem's individual data fields
		protected $lblId;
		protected $txtItemname;
		protected $txtItemnamejp;
		protected $txtDescription1;
		protected $txtDescription2;
		protected $txtPrice;
		protected $txtTaxWithin;
		protected $txtLicenseDay;
		protected $txtSubscription;
		protected $txtImage;
		protected $txtSimage;
		protected $calSuspendDate;
		protected $txtSuspended;
		protected $txtActive;

		// Controls that allow the viewing of TableItem's individual data fields
		protected $lblItemname;
		protected $lblItemnamejp;
		protected $lblDescription1;
		protected $lblDescription2;
		protected $lblPrice;
		protected $lblTaxWithin;
		protected $lblLicenseDay;
		protected $lblSubscription;
		protected $lblImage;
		protected $lblSimage;
		protected $lblSuspendDate;
		protected $lblSuspended;
		protected $lblActive;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableItemMetaControl to edit a single TableItem object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableItem object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableItemMetaControl
		 * @param TableItem $objTableItem new or existing TableItem object
		 */
		 public function __construct($objParentObject, TableItem $objTableItem) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableItemMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableItem object
			$this->objTableItem = $objTableItem;

			// Figure out if we're Editing or Creating New
			if ($this->objTableItem->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableItemMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableItem object creation - defaults to CreateOrEdit
 		 * @return TableItemMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableItem = TableItem::Load($intId);

				// TableItem was found -- return it!
				if ($objTableItem)
					return new TableItemMetaControl($objParentObject, $objTableItem);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableItem object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableItemMetaControl($objParentObject, new TableItem());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableItemMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableItem object creation - defaults to CreateOrEdit
		 * @return TableItemMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableItemMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableItemMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableItem object creation - defaults to CreateOrEdit
		 * @return TableItemMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableItemMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableItem->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QTextBox txtItemname
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtItemname_Create($strControlId = null) {
			$this->txtItemname = new QTextBox($this->objParentObject, $strControlId);
			$this->txtItemname->Name = QApplication::Translate('Itemname');
			$this->txtItemname->Text = $this->objTableItem->Itemname;
			$this->txtItemname->MaxLength = TableItem::ItemnameMaxLength;
			return $this->txtItemname;
		}

		/**
		 * Create and setup QLabel lblItemname
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblItemname_Create($strControlId = null) {
			$this->lblItemname = new QLabel($this->objParentObject, $strControlId);
			$this->lblItemname->Name = QApplication::Translate('Itemname');
			$this->lblItemname->Text = $this->objTableItem->Itemname;
			return $this->lblItemname;
		}

		/**
		 * Create and setup QTextBox txtItemnamejp
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtItemnamejp_Create($strControlId = null) {
			$this->txtItemnamejp = new QTextBox($this->objParentObject, $strControlId);
			$this->txtItemnamejp->Name = QApplication::Translate('Itemnamejp');
			$this->txtItemnamejp->Text = $this->objTableItem->Itemnamejp;
			$this->txtItemnamejp->MaxLength = TableItem::ItemnamejpMaxLength;
			return $this->txtItemnamejp;
		}

		/**
		 * Create and setup QLabel lblItemnamejp
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblItemnamejp_Create($strControlId = null) {
			$this->lblItemnamejp = new QLabel($this->objParentObject, $strControlId);
			$this->lblItemnamejp->Name = QApplication::Translate('Itemnamejp');
			$this->lblItemnamejp->Text = $this->objTableItem->Itemnamejp;
			return $this->lblItemnamejp;
		}

		/**
		 * Create and setup QTextBox txtDescription1
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtDescription1_Create($strControlId = null) {
			$this->txtDescription1 = new QTextBox($this->objParentObject, $strControlId);
			$this->txtDescription1->Name = QApplication::Translate('Description 1');
			$this->txtDescription1->Text = $this->objTableItem->Description1;
			$this->txtDescription1->MaxLength = TableItem::Description1MaxLength;
			return $this->txtDescription1;
		}

		/**
		 * Create and setup QLabel lblDescription1
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblDescription1_Create($strControlId = null) {
			$this->lblDescription1 = new QLabel($this->objParentObject, $strControlId);
			$this->lblDescription1->Name = QApplication::Translate('Description 1');
			$this->lblDescription1->Text = $this->objTableItem->Description1;
			return $this->lblDescription1;
		}

		/**
		 * Create and setup QTextBox txtDescription2
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtDescription2_Create($strControlId = null) {
			$this->txtDescription2 = new QTextBox($this->objParentObject, $strControlId);
			$this->txtDescription2->Name = QApplication::Translate('Description 2');
			$this->txtDescription2->Text = $this->objTableItem->Description2;
			$this->txtDescription2->MaxLength = TableItem::Description2MaxLength;
			return $this->txtDescription2;
		}

		/**
		 * Create and setup QLabel lblDescription2
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblDescription2_Create($strControlId = null) {
			$this->lblDescription2 = new QLabel($this->objParentObject, $strControlId);
			$this->lblDescription2->Name = QApplication::Translate('Description 2');
			$this->lblDescription2->Text = $this->objTableItem->Description2;
			return $this->lblDescription2;
		}

		/**
		 * Create and setup QIntegerTextBox txtPrice
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtPrice_Create($strControlId = null) {
			$this->txtPrice = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtPrice->Name = QApplication::Translate('Price');
			$this->txtPrice->Text = $this->objTableItem->Price;
			$this->txtPrice->Required = true;
			return $this->txtPrice;
		}

		/**
		 * Create and setup QLabel lblPrice
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblPrice_Create($strControlId = null, $strFormat = null) {
			$this->lblPrice = new QLabel($this->objParentObject, $strControlId);
			$this->lblPrice->Name = QApplication::Translate('Price');
			$this->lblPrice->Text = $this->objTableItem->Price;
			$this->lblPrice->Required = true;
			$this->lblPrice->Format = $strFormat;
			return $this->lblPrice;
		}

		/**
		 * Create and setup QIntegerTextBox txtTaxWithin
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtTaxWithin_Create($strControlId = null) {
			$this->txtTaxWithin = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtTaxWithin->Name = QApplication::Translate('Tax Within');
			$this->txtTaxWithin->Text = $this->objTableItem->TaxWithin;
			return $this->txtTaxWithin;
		}

		/**
		 * Create and setup QLabel lblTaxWithin
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblTaxWithin_Create($strControlId = null, $strFormat = null) {
			$this->lblTaxWithin = new QLabel($this->objParentObject, $strControlId);
			$this->lblTaxWithin->Name = QApplication::Translate('Tax Within');
			$this->lblTaxWithin->Text = $this->objTableItem->TaxWithin;
			$this->lblTaxWithin->Format = $strFormat;
			return $this->lblTaxWithin;
		}

		/**
		 * Create and setup QIntegerTextBox txtLicenseDay
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtLicenseDay_Create($strControlId = null) {
			$this->txtLicenseDay = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtLicenseDay->Name = QApplication::Translate('License Day');
			$this->txtLicenseDay->Text = $this->objTableItem->LicenseDay;
			return $this->txtLicenseDay;
		}

		/**
		 * Create and setup QLabel lblLicenseDay
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblLicenseDay_Create($strControlId = null, $strFormat = null) {
			$this->lblLicenseDay = new QLabel($this->objParentObject, $strControlId);
			$this->lblLicenseDay->Name = QApplication::Translate('License Day');
			$this->lblLicenseDay->Text = $this->objTableItem->LicenseDay;
			$this->lblLicenseDay->Format = $strFormat;
			return $this->lblLicenseDay;
		}

		/**
		 * Create and setup QTextBox txtSubscription
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSubscription_Create($strControlId = null) {
			$this->txtSubscription = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSubscription->Name = QApplication::Translate('Subscription');
			$this->txtSubscription->Text = $this->objTableItem->Subscription;
			$this->txtSubscription->Required = true;
			$this->txtSubscription->MaxLength = TableItem::SubscriptionMaxLength;
			return $this->txtSubscription;
		}

		/**
		 * Create and setup QLabel lblSubscription
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSubscription_Create($strControlId = null) {
			$this->lblSubscription = new QLabel($this->objParentObject, $strControlId);
			$this->lblSubscription->Name = QApplication::Translate('Subscription');
			$this->lblSubscription->Text = $this->objTableItem->Subscription;
			$this->lblSubscription->Required = true;
			return $this->lblSubscription;
		}

		/**
		 * Create and setup QTextBox txtImage
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtImage_Create($strControlId = null) {
			$this->txtImage = new QTextBox($this->objParentObject, $strControlId);
			$this->txtImage->Name = QApplication::Translate('Image');
			$this->txtImage->Text = $this->objTableItem->Image;
			$this->txtImage->TextMode = QTextMode::MultiLine;
			return $this->txtImage;
		}

		/**
		 * Create and setup QLabel lblImage
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblImage_Create($strControlId = null) {
			$this->lblImage = new QLabel($this->objParentObject, $strControlId);
			$this->lblImage->Name = QApplication::Translate('Image');
			$this->lblImage->Text = $this->objTableItem->Image;
			return $this->lblImage;
		}

		/**
		 * Create and setup QTextBox txtSimage
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSimage_Create($strControlId = null) {
			$this->txtSimage = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSimage->Name = QApplication::Translate('Simage');
			$this->txtSimage->Text = $this->objTableItem->Simage;
			$this->txtSimage->TextMode = QTextMode::MultiLine;
			return $this->txtSimage;
		}

		/**
		 * Create and setup QLabel lblSimage
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSimage_Create($strControlId = null) {
			$this->lblSimage = new QLabel($this->objParentObject, $strControlId);
			$this->lblSimage->Name = QApplication::Translate('Simage');
			$this->lblSimage->Text = $this->objTableItem->Simage;
			return $this->lblSimage;
		}

		/**
		 * Create and setup QDateTimePicker calSuspendDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calSuspendDate_Create($strControlId = null) {
			$this->calSuspendDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calSuspendDate->Name = QApplication::Translate('Suspend Date');
			$this->calSuspendDate->DateTime = $this->objTableItem->SuspendDate;
			$this->calSuspendDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calSuspendDate;
		}

		/**
		 * Create and setup QLabel lblSuspendDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblSuspendDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblSuspendDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblSuspendDate->Name = QApplication::Translate('Suspend Date');
			$this->strSuspendDateDateTimeFormat = $strDateTimeFormat;
			$this->lblSuspendDate->Text = sprintf($this->objTableItem->SuspendDate) ? $this->objTableItem->SuspendDate->__toString($this->strSuspendDateDateTimeFormat) : null;
			return $this->lblSuspendDate;
		}

		protected $strSuspendDateDateTimeFormat;


		/**
		 * Create and setup QTextBox txtSuspended
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSuspended_Create($strControlId = null) {
			$this->txtSuspended = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSuspended->Name = QApplication::Translate('Suspended');
			$this->txtSuspended->Text = $this->objTableItem->Suspended;
			$this->txtSuspended->Required = true;
			$this->txtSuspended->MaxLength = TableItem::SuspendedMaxLength;
			return $this->txtSuspended;
		}

		/**
		 * Create and setup QLabel lblSuspended
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSuspended_Create($strControlId = null) {
			$this->lblSuspended = new QLabel($this->objParentObject, $strControlId);
			$this->lblSuspended->Name = QApplication::Translate('Suspended');
			$this->lblSuspended->Text = $this->objTableItem->Suspended;
			$this->lblSuspended->Required = true;
			return $this->lblSuspended;
		}

		/**
		 * Create and setup QTextBox txtActive
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtActive_Create($strControlId = null) {
			$this->txtActive = new QTextBox($this->objParentObject, $strControlId);
			$this->txtActive->Name = QApplication::Translate('Active');
			$this->txtActive->Text = $this->objTableItem->Active;
			$this->txtActive->Required = true;
			$this->txtActive->MaxLength = TableItem::ActiveMaxLength;
			return $this->txtActive;
		}

		/**
		 * Create and setup QLabel lblActive
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblActive_Create($strControlId = null) {
			$this->lblActive = new QLabel($this->objParentObject, $strControlId);
			$this->lblActive->Name = QApplication::Translate('Active');
			$this->lblActive->Text = $this->objTableItem->Active;
			$this->lblActive->Required = true;
			return $this->lblActive;
		}



		/**
		 * Refresh this MetaControl with Data from the local TableItem object.
		 * @param boolean $blnReload reload TableItem from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableItem->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableItem->Id;

			if ($this->txtItemname) $this->txtItemname->Text = $this->objTableItem->Itemname;
			if ($this->lblItemname) $this->lblItemname->Text = $this->objTableItem->Itemname;

			if ($this->txtItemnamejp) $this->txtItemnamejp->Text = $this->objTableItem->Itemnamejp;
			if ($this->lblItemnamejp) $this->lblItemnamejp->Text = $this->objTableItem->Itemnamejp;

			if ($this->txtDescription1) $this->txtDescription1->Text = $this->objTableItem->Description1;
			if ($this->lblDescription1) $this->lblDescription1->Text = $this->objTableItem->Description1;

			if ($this->txtDescription2) $this->txtDescription2->Text = $this->objTableItem->Description2;
			if ($this->lblDescription2) $this->lblDescription2->Text = $this->objTableItem->Description2;

			if ($this->txtPrice) $this->txtPrice->Text = $this->objTableItem->Price;
			if ($this->lblPrice) $this->lblPrice->Text = $this->objTableItem->Price;

			if ($this->txtTaxWithin) $this->txtTaxWithin->Text = $this->objTableItem->TaxWithin;
			if ($this->lblTaxWithin) $this->lblTaxWithin->Text = $this->objTableItem->TaxWithin;

			if ($this->txtLicenseDay) $this->txtLicenseDay->Text = $this->objTableItem->LicenseDay;
			if ($this->lblLicenseDay) $this->lblLicenseDay->Text = $this->objTableItem->LicenseDay;

			if ($this->txtSubscription) $this->txtSubscription->Text = $this->objTableItem->Subscription;
			if ($this->lblSubscription) $this->lblSubscription->Text = $this->objTableItem->Subscription;

			if ($this->txtImage) $this->txtImage->Text = $this->objTableItem->Image;
			if ($this->lblImage) $this->lblImage->Text = $this->objTableItem->Image;

			if ($this->txtSimage) $this->txtSimage->Text = $this->objTableItem->Simage;
			if ($this->lblSimage) $this->lblSimage->Text = $this->objTableItem->Simage;

			if ($this->calSuspendDate) $this->calSuspendDate->DateTime = $this->objTableItem->SuspendDate;
			if ($this->lblSuspendDate) $this->lblSuspendDate->Text = sprintf($this->objTableItem->SuspendDate) ? $this->objTableItem->SuspendDate->__toString($this->strSuspendDateDateTimeFormat) : null;

			if ($this->txtSuspended) $this->txtSuspended->Text = $this->objTableItem->Suspended;
			if ($this->lblSuspended) $this->lblSuspended->Text = $this->objTableItem->Suspended;

			if ($this->txtActive) $this->txtActive->Text = $this->objTableItem->Active;
			if ($this->lblActive) $this->lblActive->Text = $this->objTableItem->Active;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLEITEM OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableItem instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableItem() {
			try {
				// Update any fields for controls that have been created
				if ($this->txtItemname) $this->objTableItem->Itemname = $this->txtItemname->Text;
				if ($this->txtItemnamejp) $this->objTableItem->Itemnamejp = $this->txtItemnamejp->Text;
				if ($this->txtDescription1) $this->objTableItem->Description1 = $this->txtDescription1->Text;
				if ($this->txtDescription2) $this->objTableItem->Description2 = $this->txtDescription2->Text;
				if ($this->txtPrice) $this->objTableItem->Price = $this->txtPrice->Text;
				if ($this->txtTaxWithin) $this->objTableItem->TaxWithin = $this->txtTaxWithin->Text;
				if ($this->txtLicenseDay) $this->objTableItem->LicenseDay = $this->txtLicenseDay->Text;
				if ($this->txtSubscription) $this->objTableItem->Subscription = $this->txtSubscription->Text;
				if ($this->txtImage) $this->objTableItem->Image = $this->txtImage->Text;
				if ($this->txtSimage) $this->objTableItem->Simage = $this->txtSimage->Text;
				if ($this->calSuspendDate) $this->objTableItem->SuspendDate = $this->calSuspendDate->DateTime;
				if ($this->txtSuspended) $this->objTableItem->Suspended = $this->txtSuspended->Text;
				if ($this->txtActive) $this->objTableItem->Active = $this->txtActive->Text;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableItem object
				$this->objTableItem->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableItem instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableItem() {
			$this->objTableItem->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableItem': return $this->objTableItem;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableItem fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'ItemnameControl':
					if (!$this->txtItemname) return $this->txtItemname_Create();
					return $this->txtItemname;
				case 'ItemnameLabel':
					if (!$this->lblItemname) return $this->lblItemname_Create();
					return $this->lblItemname;
				case 'ItemnamejpControl':
					if (!$this->txtItemnamejp) return $this->txtItemnamejp_Create();
					return $this->txtItemnamejp;
				case 'ItemnamejpLabel':
					if (!$this->lblItemnamejp) return $this->lblItemnamejp_Create();
					return $this->lblItemnamejp;
				case 'Description1Control':
					if (!$this->txtDescription1) return $this->txtDescription1_Create();
					return $this->txtDescription1;
				case 'Description1Label':
					if (!$this->lblDescription1) return $this->lblDescription1_Create();
					return $this->lblDescription1;
				case 'Description2Control':
					if (!$this->txtDescription2) return $this->txtDescription2_Create();
					return $this->txtDescription2;
				case 'Description2Label':
					if (!$this->lblDescription2) return $this->lblDescription2_Create();
					return $this->lblDescription2;
				case 'PriceControl':
					if (!$this->txtPrice) return $this->txtPrice_Create();
					return $this->txtPrice;
				case 'PriceLabel':
					if (!$this->lblPrice) return $this->lblPrice_Create();
					return $this->lblPrice;
				case 'TaxWithinControl':
					if (!$this->txtTaxWithin) return $this->txtTaxWithin_Create();
					return $this->txtTaxWithin;
				case 'TaxWithinLabel':
					if (!$this->lblTaxWithin) return $this->lblTaxWithin_Create();
					return $this->lblTaxWithin;
				case 'LicenseDayControl':
					if (!$this->txtLicenseDay) return $this->txtLicenseDay_Create();
					return $this->txtLicenseDay;
				case 'LicenseDayLabel':
					if (!$this->lblLicenseDay) return $this->lblLicenseDay_Create();
					return $this->lblLicenseDay;
				case 'SubscriptionControl':
					if (!$this->txtSubscription) return $this->txtSubscription_Create();
					return $this->txtSubscription;
				case 'SubscriptionLabel':
					if (!$this->lblSubscription) return $this->lblSubscription_Create();
					return $this->lblSubscription;
				case 'ImageControl':
					if (!$this->txtImage) return $this->txtImage_Create();
					return $this->txtImage;
				case 'ImageLabel':
					if (!$this->lblImage) return $this->lblImage_Create();
					return $this->lblImage;
				case 'SimageControl':
					if (!$this->txtSimage) return $this->txtSimage_Create();
					return $this->txtSimage;
				case 'SimageLabel':
					if (!$this->lblSimage) return $this->lblSimage_Create();
					return $this->lblSimage;
				case 'SuspendDateControl':
					if (!$this->calSuspendDate) return $this->calSuspendDate_Create();
					return $this->calSuspendDate;
				case 'SuspendDateLabel':
					if (!$this->lblSuspendDate) return $this->lblSuspendDate_Create();
					return $this->lblSuspendDate;
				case 'SuspendedControl':
					if (!$this->txtSuspended) return $this->txtSuspended_Create();
					return $this->txtSuspended;
				case 'SuspendedLabel':
					if (!$this->lblSuspended) return $this->lblSuspended_Create();
					return $this->lblSuspended;
				case 'ActiveControl':
					if (!$this->txtActive) return $this->txtActive_Create();
					return $this->txtActive;
				case 'ActiveLabel':
					if (!$this->lblActive) return $this->lblActive_Create();
					return $this->lblActive;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableItem fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'ItemnameControl':
						return ($this->txtItemname = QType::Cast($mixValue, 'QControl'));
					case 'ItemnamejpControl':
						return ($this->txtItemnamejp = QType::Cast($mixValue, 'QControl'));
					case 'Description1Control':
						return ($this->txtDescription1 = QType::Cast($mixValue, 'QControl'));
					case 'Description2Control':
						return ($this->txtDescription2 = QType::Cast($mixValue, 'QControl'));
					case 'PriceControl':
						return ($this->txtPrice = QType::Cast($mixValue, 'QControl'));
					case 'TaxWithinControl':
						return ($this->txtTaxWithin = QType::Cast($mixValue, 'QControl'));
					case 'LicenseDayControl':
						return ($this->txtLicenseDay = QType::Cast($mixValue, 'QControl'));
					case 'SubscriptionControl':
						return ($this->txtSubscription = QType::Cast($mixValue, 'QControl'));
					case 'ImageControl':
						return ($this->txtImage = QType::Cast($mixValue, 'QControl'));
					case 'SimageControl':
						return ($this->txtSimage = QType::Cast($mixValue, 'QControl'));
					case 'SuspendDateControl':
						return ($this->calSuspendDate = QType::Cast($mixValue, 'QControl'));
					case 'SuspendedControl':
						return ($this->txtSuspended = QType::Cast($mixValue, 'QControl'));
					case 'ActiveControl':
						return ($this->txtActive = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>